UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3CdzGRaGgMSiN2AMu8PwPtjLPV6MXc8jPkUyI/IlZ0o=' 
WHERE 
  key_id = '91236739b0f3535900645c21b528c2073719a67061514f5293f4dab02577241e' 
  AND (
    token = '3CdzGRaGgMSiN2AMu8PwPtjLPV6MXc8jPkUyI/IlZ0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024