UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SVkpH17XKX6Io09S8ZFISBlS3Tyy6JQV7HV6mwwjtW0=' 
WHERE 
  key_id = '2d2bbfbbb5a53c9daab4d2fe719c6a5d63912b40d48b2e67e19e954129e26dbf' 
  AND (
    token = 'SVkpH17XKX6Io09S8ZFISBlS3Tyy6JQV7HV6mwwjtW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030