UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hEvUB5f9YO8+MdSIJ91o2hk802ZlumgGEmxe1mH/QjM=' 
WHERE 
  key_id = '6856ed8e87695c46de0065ff52093360cac879dfaf9bec64d84ed1455a98b380' 
  AND (
    token = 'hEvUB5f9YO8+MdSIJ91o2hk802ZlumgGEmxe1mH/QjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021