UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SHNUUxp9EmD4V4HgoMDfJTYYNPgT5cPQuM3k/1JLXqA='
WHERE
key_id = 'c148bf6d94c752871bf6136f1c27953501b7b7ce8194f22a116d362a8ad768f9'
AND (
token = 'SHNUUxp9EmD4V4HgoMDfJTYYNPgT5cPQuM3k/1JLXqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)