UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n8ot42oBSUDAFdJXn8MlHTaWiEnmp14WFq+atOTweMA='
WHERE
key_id = '67fda85271da44a06551234924354ce0b89cbd814abdad501999fcc800e247a9'
AND (
token = 'n8ot42oBSUDAFdJXn8MlHTaWiEnmp14WFq+atOTweMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)