UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gtMq4/fh8byTw8ZD/iPtAYRFoUmPWitxNdccwpF4EUo=' 
WHERE 
  key_id = 'e14ab56c0048f9f44e46889921eade0a3ac8a3b7afaa877da0d48a63bdd7a6f6' 
  AND (
    token = 'gtMq4/fh8byTw8ZD/iPtAYRFoUmPWitxNdccwpF4EUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038