UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'erUQjlompHxPmve6+LpWk95mWR9GDlitnETaWZU6/4A='
WHERE
key_id = '1e5900e87aa91d739cd31942e525c5da2e6b1f62f0d11e20a884c4c2c80be79a'
AND (
token = 'erUQjlompHxPmve6+LpWk95mWR9GDlitnETaWZU6/4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)