UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nDMp0D/GGm9qp6BqxEpnuaESIC6k6kxE1qC1zFdEMRM=' 
WHERE 
  key_id = '0cf26f9573d002f96e49c649e694a4e84c0b2f0ab8003458ee828fe34df6894d' 
  AND (
    token = 'nDMp0D/GGm9qp6BqxEpnuaESIC6k6kxE1qC1zFdEMRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041