UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4shb9kVXboKDisrDK6Ai5WpXmxBOx6u+/dyXGG9ex+0=' 
WHERE 
  key_id = 'c0f3c3427f9cae6b285fd79899fce5055db1333b8e1fdaf369269ffe42c9e361' 
  AND (
    token = '4shb9kVXboKDisrDK6Ai5WpXmxBOx6u+/dyXGG9ex+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042