UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bF/mg0hc6fvO9jdMsRt3WZCtC4/Iy+MAEf4KTRiiu7g=' 
WHERE 
  key_id = '75ebd55d903c09e7736cbccfe0d58582c7173ce68d9cbbc14a8871be37755fbd' 
  AND (
    token = 'bF/mg0hc6fvO9jdMsRt3WZCtC4/Iy+MAEf4KTRiiu7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052