UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C4kSQE+QtQkDg1OzBNBWc5kJyUEiUb4bKPwtR00b3Iw=' 
WHERE 
  key_id = 'ff1900d546e29faf49013d2e62a6a73485847ed82ed0e835d83f266b67b810cb' 
  AND (
    token = 'C4kSQE+QtQkDg1OzBNBWc5kJyUEiUb4bKPwtR00b3Iw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064