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