UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0yinmyK7pKhD+CJz9hVn0jQwPSNFMSjv7YR3Gy+A8sY=' 
WHERE 
  key_id = '459660be5ae9d2115f0595dbcdc42c6147baba77c44fd4b21f99774d85e71bfb' 
  AND (
    token = '0yinmyK7pKhD+CJz9hVn0jQwPSNFMSjv7YR3Gy+A8sY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020