UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PGVynnbsYO9xcj1UiFzfTUzCWQ8nO34xpvlgjh9HNwg=' 
WHERE 
  key_id = '1c3ee11a150b59fe7407ce006002e661689917a5fb474d9d2468a3caf34302ce' 
  AND (
    token = 'PGVynnbsYO9xcj1UiFzfTUzCWQ8nO34xpvlgjh9HNwg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018