UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/k8sXKRWxbdnfmXwPb5076kRZ9k2OXrQ84yXbVpIYc=' 
WHERE 
  key_id = 'bbcec359c05183747885dace16ad0f161be15b76a2d1a2b0b1683a92fb1840d3' 
  AND (
    token = 'o/k8sXKRWxbdnfmXwPb5076kRZ9k2OXrQ84yXbVpIYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026