UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cqAAnoI5hmqRc+JEKRWRUU3UPpaGso5rpA6Y6QfQcug=' 
WHERE 
  key_id = '942e5813ef920b6b9c7ce30ba9c7acbb105354497e4205d55e1761c79ae4e1c1' 
  AND (
    token = 'cqAAnoI5hmqRc+JEKRWRUU3UPpaGso5rpA6Y6QfQcug=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041