UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h6GveQEvSFSu3IRM4c3UGhkc7ON6X91I9h7vNCj5BqY=' 
WHERE 
  key_id = '16f379feaf60465131abf8c96f7898780d29ae259a8e8a8302cb4508ed7bf55d' 
  AND (
    token = 'h6GveQEvSFSu3IRM4c3UGhkc7ON6X91I9h7vNCj5BqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031