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

Query time 0.00015