UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ccQgSUaaiDRFphBy6+tdJjlxIJgZDsAnIofbXlwXQUQ=' 
WHERE 
  key_id = '44a131e692e1681e42fb0dff036bc5726fbd483e5895be08e4ebec6c2a547d89' 
  AND (
    token = 'ccQgSUaaiDRFphBy6+tdJjlxIJgZDsAnIofbXlwXQUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042