UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/dUEN9UZ5sRXHkf/XOVHRGV39K39SXe4/ok5Vk+VWlk=' 
WHERE 
  key_id = '9e483fe5e00816144a910e8eb4852e37934c8ab65b5e5267cd4f8b65bf4ceb4f' 
  AND (
    token = '/dUEN9UZ5sRXHkf/XOVHRGV39K39SXe4/ok5Vk+VWlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027