UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IzfZYHAdas7tA7def5DvVpz98nAGHgbxZR0MYxrGw3A=' 
WHERE 
  key_id = 'e3c67de7f8f1017f5c34db89979742ef154231690d23d7b5bb8205741c3b8c7d' 
  AND (
    token = 'IzfZYHAdas7tA7def5DvVpz98nAGHgbxZR0MYxrGw3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021