UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GuVJADciMyvb+faYMQZXKgyQ8dGA0chPPGTuDAQdEnI=' 
WHERE 
  key_id = 'eabdc47d99e293c663b49c20b5950d269e65bf44da3eab5ab3392245182a05eb' 
  AND (
    token = 'GuVJADciMyvb+faYMQZXKgyQ8dGA0chPPGTuDAQdEnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030