UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KvbnDerAcxtZDAlinX2DeI6ep/S0X20ijU7l2OLH+fs=' 
WHERE 
  key_id = '29a2ac46644b8945edb829d61347d3f100fb0d95211f3c8b71911ed6f8542345' 
  AND (
    token = 'KvbnDerAcxtZDAlinX2DeI6ep/S0X20ijU7l2OLH+fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018