UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gFxTf/j6mhsVe0TS6cnuzWOEcCnBJ7+B899C1fiCA98=' 
WHERE 
  key_id = '6e8ab78c1753c290a771d483753236f5d6a83d3aba5edb39f52a9dc392e5c82b' 
  AND (
    token = 'gFxTf/j6mhsVe0TS6cnuzWOEcCnBJ7+B899C1fiCA98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023