UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ztA3OFrBK+3ttKFQK32bRRB0KTjVSL7jVi5pxNEOZW4=' 
WHERE 
  key_id = '4edbc3ab4604d061c1a36d93934442c77108714a1a9f9d04908a0efbdea83cc5' 
  AND (
    token = 'ztA3OFrBK+3ttKFQK32bRRB0KTjVSL7jVi5pxNEOZW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00065