UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LDGTz00n19ExWRW/ET0BtGwF3XkmfXWiTy7jqear5W0=' 
WHERE 
  key_id = 'f988febc5a6d1a441cbaa6a27d23d0ff6fadc20d72be0b363f7c1fb7b72ef0e6' 
  AND (
    token = 'LDGTz00n19ExWRW/ET0BtGwF3XkmfXWiTy7jqear5W0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047