UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UDRm2cXr871YPIbkDOlx9CKSUd3Xn4Z72iEDN5yVSLU='
WHERE
key_id = '8a68cbee6232e22815fbe048876388b1f231e79e11eeeede6696faa759fedb9e'
AND (
token = 'UDRm2cXr871YPIbkDOlx9CKSUd3Xn4Z72iEDN5yVSLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)