UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MM+s8TSbtigZVaUZCqVHpEhBHb21akeWWYktaJMqdPs=' 
WHERE 
  key_id = '175d6e0c8b568d59b5daf024f960484a9397dfff704611860d9fadbabaffa8d1' 
  AND (
    token = 'MM+s8TSbtigZVaUZCqVHpEhBHb21akeWWYktaJMqdPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047