UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Ib4a9B67hpXawkSulzvPaR1i/MjCFTFC1hWL82W4S0=' 
WHERE 
  key_id = '7d0a4f5d5dc9b6461f81093b2f214c6c8d1d0ee9301cd208a7ed379a4050683e' 
  AND (
    token = '2Ib4a9B67hpXawkSulzvPaR1i/MjCFTFC1hWL82W4S0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047