UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aSSzg24bS6MuH/Dw7e8P6GKeo/grbF0TLuRw+w9rfkc=' 
WHERE 
  key_id = '1cdce73f214a0ce9d3bbd66086a22f71288dd33650f74b54a9c2fa8043ab6df8' 
  AND (
    token = 'aSSzg24bS6MuH/Dw7e8P6GKeo/grbF0TLuRw+w9rfkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033