UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6+tsEUWk5Rjbzarx7IzNtchxxNqYws7V2kgkpnr10Qw=' 
WHERE 
  key_id = '5f6759dcdfa811f2f29be5701d86fb0a89d5c0bf82b13578fcedbf5e7ef316a2' 
  AND (
    token = '6+tsEUWk5Rjbzarx7IzNtchxxNqYws7V2kgkpnr10Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055