UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zcksVnR14BprCadSB2PcDoeOuDGToPVfNdgAr+MJakE=' 
WHERE 
  key_id = '900fdbb262860a7b03429725c2c6a7b79d8bf6468b6db8867ada5af026b457de' 
  AND (
    token = 'zcksVnR14BprCadSB2PcDoeOuDGToPVfNdgAr+MJakE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049