UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PJfNbLyJC3NbWeOO6IkaWfa95fOpUCq+8fgneKjbolE=' 
WHERE 
  key_id = '68279842401122ff13ba0a1346cdc661f9ccae0fefea0d47b7c1198d2c404ee8' 
  AND (
    token = 'PJfNbLyJC3NbWeOO6IkaWfa95fOpUCq+8fgneKjbolE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029