UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RFbf1ol0uMxW9onrC8OmDBfzc/A+TyxcV6pA0+zsnJk='
WHERE
key_id = '37a747f990eb8e7a9d19633c16714cf40180c646cd723fac1b851ad1b97e179d'
AND (
token = 'RFbf1ol0uMxW9onrC8OmDBfzc/A+TyxcV6pA0+zsnJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)