UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6mlCcpqXQ5oeB99/M+EAfwGqnCcl4TZCtgq6cnYdwc8=' 
WHERE 
  key_id = 'e250ebfb924b6e3aaf63be0d592bff37885c88c93561d1a0ef39a780f17cfd21' 
  AND (
    token = '6mlCcpqXQ5oeB99/M+EAfwGqnCcl4TZCtgq6cnYdwc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062