UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vrHXkKM9SAJIwyvZi+BMWoVWj4Ec2HsmfpovAdEQjBU=' 
WHERE 
  key_id = 'e493f2fae002319b35a229084d53ea49d765860fe738ce70650cc11f0cedc6d4' 
  AND (
    token = 'vrHXkKM9SAJIwyvZi+BMWoVWj4Ec2HsmfpovAdEQjBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047