UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gJgQSeiPuljKaFaVZ9zx2x2N9gmr3Vbda1Zpjsx6B+g=' 
WHERE 
  key_id = 'f5ab030a266ace08e1e1210d0a087865d7e359bef0fd5f0808bb41af1c9eb4e6' 
  AND (
    token = 'gJgQSeiPuljKaFaVZ9zx2x2N9gmr3Vbda1Zpjsx6B+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023