UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q/P3TwaV6AmypuoZRgZ6IU1KETRZY4rOU8nWHbNvVRY=' 
WHERE 
  key_id = '7105f7cbb67d0a88faae65d32962cf5a8a1e622a3db2f7d08b817c78dc86b2cc' 
  AND (
    token = 'Q/P3TwaV6AmypuoZRgZ6IU1KETRZY4rOU8nWHbNvVRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035