UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ywphwkoLktiH4nC2ATeBwNJlmPvcTz0Zjc1Xg6XyzzA=' 
WHERE 
  key_id = '28c66078c775c572c4e38d1648aa0fbbe6bae9d5bc3101a97964a4c9f2164b1a' 
  AND (
    token = 'ywphwkoLktiH4nC2ATeBwNJlmPvcTz0Zjc1Xg6XyzzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030