UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yF0pCRGC7kvA+7oqHHzgiAgLmLJHta3egawlPLWZcRk='
WHERE
key_id = '96152ed3af80307195196fd63e6dbb5f318fcafec5a79e8304048aa294d48f56'
AND (
token = 'yF0pCRGC7kvA+7oqHHzgiAgLmLJHta3egawlPLWZcRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)