UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tejwfzBRmWt9nyVvZbRe6afT1Yli3xGxUwYKOqjwf7c=' 
WHERE 
  key_id = '69981c1b809d5ca170c45d87bc9b1c87ddc3b11d7eb8c94effb7de358909c0ef' 
  AND (
    token = 'tejwfzBRmWt9nyVvZbRe6afT1Yli3xGxUwYKOqjwf7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022