UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQ0ytRckL89HjQQut6m3ezsHjrRdZrDbw9+JhpYEXWM=' 
WHERE 
  key_id = '0c045f36350e4dfd4394038e7c3a13528a93a424896fbaf914dfd4c7e1f3ae5e' 
  AND (
    token = 'tQ0ytRckL89HjQQut6m3ezsHjrRdZrDbw9+JhpYEXWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023