UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pb5ONkHw39om4RPc+mcKwMJv6Xg64iKGg30AuCXrLyk='
WHERE
key_id = 'dffa4cdee1fb24625f8922eebd79cc9210abe80f7e985106ab66634439f9d6c4'
AND (
token = 'pb5ONkHw39om4RPc+mcKwMJv6Xg64iKGg30AuCXrLyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)