UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/eEOpwQl7fjBv//ULZN7NSnlXPqLzcILcfh0QD7+wTE='
WHERE
key_id = 'e2894dbf0589429b543b0ce75b235bf8a42cfd0211431cac3ec35faa02252b01'
AND (
token = '/eEOpwQl7fjBv//ULZN7NSnlXPqLzcILcfh0QD7+wTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)